package com.codeying.servlet.user;

import com.codeying.entity.*;
import com.codeying.servlet.AbsServlet;
import com.codeying.utils.*;
import javax.servlet.ServletException;
import javax.servlet.annotation.WebServlet;
import javax.servlet.http.*;
import java.io.IOException;

/**
 * 用户详情页面
 */
@WebServlet("/user/detail")
public class DetailUserServlet extends AbsServlet {

    @Override
    public void doGet(HttpServletRequest req, HttpServletResponse resp) throws IOException, ServletException {
        req.setCharacterEncoding("utf-8");
        String id = req.getParameter("id");
        User item = userService.getById(id);
        req.setAttribute("item", item);
        req.getRequestDispatcher("/pages/user-detail.jsp").forward(req, resp);
    }
}

